package com.example.spingbootvue.service;

import com.example.spingbootvue.entity.User;
import com.example.spingbootvue.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class editmsgservice {

    @Autowired
    UserMapper userMapper;
    public int updatemsg(User user){
        if(user.getAccount()==null||
                "".equals(user.getAccount())||user.getPassword()==null||"".equals(user.getPassword())||
                user.getPosition()==null||"".equals(user.getPosition())||user.getEmail()==null||"".equals(user.getEmail())
        ){
            return 0;
        }else {
            return userMapper.updateAll(user.getAccount(),user.getPassword(),user.getPosition(),user.getEmail(),user.getId());
        }
    }
}
